package app;

import java.io.Serializable;

public class Request implements Serializable {
	
	public Request() {
		type = CHAT_MSG;
	}
	
	public Request(User s, User t) {
		this();
		source = s;
		target = t;
	}
	
	public User getSource() {
		return source;
	}
	
	public User getTarget() {
		return target;
	}
	
	public void setSource(User source) {
		this.source = source;
	}
	
	public void setTarget(User target) {
		this.target = target;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}
	
	public String toString() {
		return 	" Request...\n" +
				" Type  : "+type+"\n"+
				" Source: "+source+"\n"+
				" Target: "+target+"\n"+
				" Msg   : "+msg;
	}

	public Object getMsg() {
		return msg;
	}

	public void setMsg(Object msg) {
		this.msg = msg;
	}

	private static final long serialVersionUID 	= 4839305074811996924L;
	public static final int CHAT_MSG 			= 0;
	public static final int PRIVATE_CHAT_MSG 	= 1;
	public static final int GAME_REQUEST 		= 2;
	public static final int GAME_RESPONSE 		= 3;
	public static final int DONE				= 4;
	public static final int POS_REQUEST 		= 5;
	public static final int POS_RESPONSE 		= 6;
	public static final int GET_ID 				= 7;
	public static final int ATTACK				= 8;
	
	private int type;
	private User source;
	private User target;
	private Object msg;
}
